//
//  LSTagLine.m
//  听说弱点强化训练
//
//  Created by 盛超 on 2018/10/10.
//  Copyright © 2018年 盛超. All rights reserved.
//

#import "LSTagLine.h"
#import "LSModelHome.h"

@implementation LSTagLine

/*
// Only override drawRect: if you perform custom drawing.
// An empty implementation adversely affects performance during animation.
- (void)drawRect:(CGRect)rect {
    // Drawing code
}
*/
- (id)initwithData:(NSArray *)dataArr Colors:(NSArray *)colors {
    if (self==[super init]) {
        
        for (NSInteger i = 0; i<dataArr.count; i++) {
            /*
            UILabel *label = [[UILabel alloc] init];
            [self addSubview:label];
            label.backgroundColor = colors[i];
            [label mas_makeConstraints:^(MASConstraintMaker *make) {
                make.left.equalTo(self);
                make.top.equalTo(self).offset(i*25);
                make.size.mas_equalTo(CGSizeMake(30, 3));
            }];
            
            UILabel *textLabel = [[UILabel alloc] init];
            [self addSubview:textLabel];
            LSabiSocre *model = dataArr[i];
            textLabel.text = model.AbiScoreType;
            textLabel.font = FONT(10);
            [textLabel mas_makeConstraints:^(MASConstraintMaker *make) {
                make.left.equalTo(label);
                make.top.equalTo(label.mas_bottom).offset(2);
                make.size.mas_equalTo(CGSizeMake(55, 10));
            }];*/
            UILabel *label = [[UILabel alloc] init];
            [self addSubview:label];
            label.backgroundColor = colors[i];
            [label mas_makeConstraints:^(MASConstraintMaker *make) {
                make.left.equalTo(self);
                make.top.equalTo(self).offset(i*25*ScalesW);
                make.size.mas_equalTo(CGSizeMake(5*ScalesW, 5*ScalesW));
            }];
            
            UILabel *textLabel = [[UILabel alloc] init];
            [self addSubview:textLabel];
            LSabiSocre *model = dataArr[i];
            textLabel.text = model.AbiScoreType;
            textLabel.font = FONT(10*ScalesW);
            [textLabel mas_makeConstraints:^(MASConstraintMaker *make) {
                make.left.equalTo(label.mas_right).offset(2*ScalesW);
                make.top.equalTo(label).offset(-2.5*ScalesW);
                make.size.mas_equalTo(CGSizeMake(55*ScalesW, 10*ScalesW));
            }];
            
        }
        
    }
    
    return self;
}

@end
